package com.yq.interview.jvm.study.oom;

/**
 * @ClassName MetaspaceOOMDemo
 * @Description TODO
 * @Author yaoqiang
 * @Date 2020/11/26 11:01
 * @Version 1.0
 *
 * -XX:MetaspaceSize=8m -XX:MaxMetaspaceSize=8m
 */
public class MetaspaceOOMDemo {
    static class OOMTest { }
    public static void main(String[] args) {
        int i=0;//计数器
        try {
            while (true){
                i++;
//                Enhancer enhancer = new Enhancer();//cglib下
//                enhancer.setSuperclass(EnhancerDemo.class);
            }
        }catch (Exception e){
            System.out.println("发生异常时i="+i);
            e.printStackTrace();
        }
    }
}
